%%{init: {'themeVariables': { 'fontSize': '12px'}}}%%
graph TD
    classDef path fill:#eee,stroke:#000,color:#000
    classDef plan fill:#fff,stroke-width:1px,color:#000
    classDef itemplan fill:#fff,stroke-width:2px,color:#000
    classDef unbatchedplan fill:#dff,stroke-width:1px,color:#000
    classDef sideeffectplan fill:#fcc,stroke-width:2px,color:#000
    classDef bucket fill:#f6f6f6,color:#000,stroke-width:2px,text-align:left

    subgraph "Buckets for queries/interfaces-relational/single-topic-not-topic"
    Bucket0("Bucket 0 (root)<br /><br />1: PgSelectInlineApply[60]<br />ᐳ: 8, 9, 64, 10<br />2: PgSelect[7]<br />ᐳ: Access[61]<br />3: PgSelectRows[12]<br />ᐳ: First[11], PgSelectSingle[13]"):::bucket
    Bucket1("Bucket 1 (nullableBoundary)<br />Deps: 13, 61<br /><br />ROOT PgSelectSingleᐸrelational_topicsᐳ[13]<br />1: <br />ᐳ: 14, 59, 62, 63<br />2: PgSelectRows[20]<br />ᐳ: 19, 21, 22, 28, 34, 40, 46, 52, 58"):::bucket
    end
    Bucket0 --> Bucket1

    %% plan dependencies
    PgSelect7[["PgSelect[7∈0] ➊<br />ᐸrelational_topicsᐳ<br />More deps:<br />- Constantᐸ12ᐳ[64]"]]:::plan
    Object10{{"Object[10∈0] ➊<br />ᐸ{pgSettings,withPgClient}ᐳ"}}:::plan
    PgSelectInlineApply60["PgSelectInlineApply[60∈0] ➊"]:::plan
    Object10 & PgSelectInlineApply60 --> PgSelect7
    Access8{{"Access[8∈0] ➊<br />ᐸ2.pgSettingsᐳ"}}:::plan
    Access9{{"Access[9∈0] ➊<br />ᐸ2.withPgClientᐳ"}}:::plan
    Access8 & Access9 --> Object10
    __Value2["__Value[2∈0] ➊<br />ᐸcontextᐳ"]:::plan
    __Value2 --> Access8
    __Value2 --> Access9
    First11{{"First[11∈0] ➊"}}:::plan
    PgSelectRows12[["PgSelectRows[12∈0] ➊"]]:::plan
    PgSelectRows12 --> First11
    PgSelect7 --> PgSelectRows12
    PgSelectSingle13{{"PgSelectSingle[13∈0] ➊<br />ᐸrelational_topicsᐳ"}}:::plan
    First11 --> PgSelectSingle13
    Access61{{"Access[61∈0] ➊<br />ᐸ7.m.joinDetailsFor15ᐳ"}}:::plan
    PgSelect7 --> Access61
    List62{{"List[62∈1] ➊<br />ᐸ61,13ᐳ"}}:::plan
    Access61 & PgSelectSingle13 --> List62
    PgClassExpression14{{"PgClassExpression[14∈1] ➊<br />ᐸ__relation...ics__.”id”ᐳ"}}:::plan
    PgSelectSingle13 --> PgClassExpression14
    First19{{"First[19∈1] ➊"}}:::plan
    PgSelectRows20[["PgSelectRows[20∈1] ➊"]]:::plan
    PgSelectRows20 --> First19
    Lambda63{{"Lambda[63∈1] ➊<br />ᐸpgInlineViaJoinTransformᐳ"}}:::plan
    Lambda63 --> PgSelectRows20
    PgSelectSingle21{{"PgSelectSingle[21∈1] ➊<br />ᐸrelational_itemsᐳ"}}:::plan
    First19 --> PgSelectSingle21
    PgClassExpression22{{"PgClassExpression[22∈1] ➊<br />ᐸ__relation...s__.”type”ᐳ"}}:::plan
    PgSelectSingle21 --> PgClassExpression22
    PgClassExpression28{{"PgClassExpression[28∈1] ➊<br />ᐸ__relation...__.”type2”ᐳ"}}:::plan
    PgClassExpression22 o--o PgClassExpression28
    PgClassExpression34{{"PgClassExpression[34∈1] ➊<br />ᐸ__relation...”position”ᐳ"}}:::plan
    PgClassExpression28 o--o PgClassExpression34
    PgClassExpression40{{"PgClassExpression[40∈1] ➊<br />ᐸ__relation...reated_at”ᐳ"}}:::plan
    PgClassExpression34 o--o PgClassExpression40
    PgClassExpression46{{"PgClassExpression[46∈1] ➊<br />ᐸ__relation...pdated_at”ᐳ"}}:::plan
    PgClassExpression40 o--o PgClassExpression46
    PgClassExpression52{{"PgClassExpression[52∈1] ➊<br />ᐸ__relation..._archived”ᐳ"}}:::plan
    PgClassExpression46 o--o PgClassExpression52
    PgClassExpression58{{"PgClassExpression[58∈1] ➊<br />ᐸ__relation...chived_at”ᐳ"}}:::plan
    PgClassExpression52 o--o PgClassExpression58
    PgClassExpression59{{"PgClassExpression[59∈1] ➊<br />ᐸ__relation...__.”title”ᐳ"}}:::plan
    PgClassExpression14 o--o PgClassExpression59
    List62 --> Lambda63

    %% define steps
    classDef bucket0 stroke:#696969
    class Bucket0,__Value2,PgSelect7,Access8,Access9,Object10,First11,PgSelectRows12,PgSelectSingle13,PgSelectInlineApply60,Access61 bucket0
    classDef bucket1 stroke:#00bfff
    class Bucket1,PgClassExpression14,First19,PgSelectRows20,PgSelectSingle21,PgClassExpression22,PgClassExpression28,PgClassExpression34,PgClassExpression40,PgClassExpression46,PgClassExpression52,PgClassExpression58,PgClassExpression59,List62,Lambda63 bucket1

